home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group00a.txt / 000155_icon-group-sender _Fri Jun 23 08:15:13 2000.msg < prev    next >
Internet Message Format  |  2001-01-03  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA11792
  4.     for icon-group-addresses; Fri, 23 Jun 2000 08:15:03 -0700 (MST)
  5. Message-Id: <200006231515.IAA11792@baskerville.CS.Arizona.EDU>
  6. Date: Fri, 23 Jun 2000 07:57:52 -0700
  7. From: Steve Wampler <swampler@noao.edu>
  8. X-Accept-Language: en
  9. To: icon-group <icon-group@optima.CS.Arizona.EDU>, jsampson@indexes.u-net.com
  10. Subject: Re: Error messages
  11. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  12. Status: RO
  13.  
  14. "J.R. Sampson" wrote:
  15.  
  16. > I had an error message 114, 'Invalid type to subscript operation'
  17. > which I eventually traced to the fact that I had typed square
  18. > brackets where there should have been parens. However, the
  19. > phrase quoted doesn't make sense to me as it stands. What I had
  20. > done was to write, in effect, 'foo := set[bar]' - perhaps if I don't
  21. > make sense to the compiler I can't expect it to make sense to me!
  22. > It is really a syntax error.
  23.  
  24. Actually, no - it's not a syntax error.  Function names are not
  25. reserved names, but simply global variables with predefined values.
  26.  
  27. Somewhere earlier (in the execution of the program) you may have
  28. done:
  29.  
  30.     set := table()
  31.  
  32. and then the line
  33.  
  34.     foo := set[bar]
  35.  
  36. makes complete sense.  (This type of language flexibility does
  37. make it difficult to produce error messages that always make
  38. sense to the user, who may be thinking of something entirely
  39. different - which is why having a traceback that includes line
  40. numbers is so useful!)
  41.  
  42.  
  43. --
  44. Steve Wampler-  SOLIS Project, National Solar Observatory
  45. swampler@noao.edu
  46.